package net.huashitong.supervision.task.service;

import com.sirdc.modules.core.dao.BaseDao;
import com.sirdc.modules.sys.base.StringPKService;
import com.sirdc.modules.sys.service.SysTableService;
import net.huashitong.supervision.task.dao.ReadDocDraftDao;
import net.huashitong.supervision.task.entity.ReadDocDraft;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

/**
 * Created with IntelliJ IDEA.
 *
 * @author ling
 * @date: 2020/2/10
 * @time: 10:33
 * @version: 1.0
 * @Description:
 */
@Service
public class ReadDocDraftService extends StringPKService<ReadDocDraft> {
    @Autowired
    private ReadDocDraftDao dao;
    @Autowired
    private SysTableService tableService;
    @Override
    protected BaseDao<ReadDocDraft, String> getDao() {
        return dao;
    }
    @Override
    protected void beforeSave(ReadDocDraft obj) {
        obj.setSysId(tableService.updateMaxSysId("t_read_doc_draft",null));
    }

    public List<ReadDocDraft> queryList(ReadDocDraft draft){
        return dao.queryList(draft);
    }
}
